
<!-- 引入样式 -->
<script type="text/html" template>
    <link rel="stylesheet" href="{{ layui.setter.base }}style/css/reset.css">
    <link rel="stylesheet" href="{{ layui.setter.base }}style/css/maintain.css">
    <link rel="stylesheet" href="{{ layui.setter.base }}style/index.css">
    <link rel="stylesheet" href="{{ layui.setter.base }}style/autoComplete.css">
    <link rel="stylesheet" href="{{ layui.setter.base }}style/page.css">
    <link rel="stylesheet" href="{{ layui.setter.base }}style/alert-form.css">
</script>
<style scoped>
      .btn1,.btn2 {
        display:inline-block;
        width: 70px;
        height: 25px;
        font-size: 12px;
        color: #fff;
        line-height: 0px;
        margin: 0;
        padding: 0 5px;
        border: 0;
        text-align: center;
        cursor: pointer;
    }
    .btn1{
        width: 60px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 11px;
        margin: 0;
        padding: 0 5px;
        border: 0;
        text-align: center;
        background-color: #FF4C4C;
        line-height: 22px;
        height: 22px;
    }
    .add-btn{
        display: flex;
        width: auto !important;
        min-width: 69px;
        padding: 0 5px !important;
        border: 0;
        margin: 0;
    }
    .inputQuery {
        background: #FF4C4C;
        width: 36px;
        border: none;
    }

    .layui-title-screen {
        text-align: center;
        display: inline-block;
        height: 20px;
        line-height: 20px;
    }

    .layui-tab-item .screen-btn {
        display: inline-block;
        position: relative;
        height: 20px;
        line-height: 20px;
        border: 1px solid #DEDEDE;
        border-radius: 10px;
        margin: 0;
        margin-right: 0;
        right: 0;
        padding-left: 5px;
    }

    .layui-tab-item .screen-btn {
        display: inline-block;
        position: relative;
        width: inherit;
        height: 20px;
        line-height: 20px;
        border: 1px solid #FF4C4C;
        border-radius: 10px;
        margin: 0;
        margin-right: 0;
        right: 0;
        padding-left: 5px;
        margin-right: 10px;
        background-color: #FF4C4C;
    }

    .layui-tab-item .search-blank-inner,
    .layui-tab-item .my_ipt {
        display: inline-block;
        position: relative;
        top: -7px;
        left: -6px;
        font-size: 10px;
        background-color: #FF4C4C;
    }

    .layui-tab-item .searchInput,
    .layui-tab-item .my_ipt {
        border: 0;
        width: 65px;
        height: 20px;
        line-height: 20px;
        transition: all 0.5s ease 0s;
        background-color: #FF4C4C;
        z-index: 2;
        padding: 0;
        color: #FFFFFF;
    }

    .layui-tab-item .searchInput::-webkit-input-placeholder,
    .layui-tab-item .my_ipt::-webkit-input-placeholder {
        color: #FFFFFF;
    }

    .layui-tab-item .search-blank-icon {
        background: url(./../dist/img/search@2x.png);
        background-size: cover;
        right: 0;
        border: 0;
        cursor: pointer;
        position: relative;
        left: -5px;
        width: 20px;
        outline: 0;
    }
</style>
<script type="text/html" id="onlyDelEdit">
        <i class="layui-icon layui-icon-edit" style="cursor:pointer" lay-event="edit"></i>
        <i class="layui-icon layui-icon-delete" style="cursor:pointer" lay-event="del"></i>
    </script>
<script type="text/html" id="onlyDel">
        <i class="layui-icon layui-icon-delete" style="cursor:pointer" lay-event="del"></i>
</script>
<!-- tab选项卡 -->
<div class="layui-fluid">
    <div class="">
        <div class="table-box  layui-row">
            <div class="">
                <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
                    <div class="layui-tab" lay-filter="filter">
                        <!-- tab选项卡导航 -->
                        <ul class="layui-tab-title">
                            <li class="layui-this UnitType" data-lang="DEVSeries" data_ch="设备系列" data_en="Unit Type">
                                设备系列</li>
                            <li class="DEVseries" data-lang="unitType" data_ch="设备型号" data-lang="Equipmentseries">
                                设备型号</li>
                            <li class="BuildingMaterials" data-lang="BuildingMaterials" data_ch="厂房资料"
                                data_en="Building Materials">厂房资料</li>
                            <li class="WorkshopFloor" data-lang="WorkshopFloor" data_ch="厂房楼层" data_en="Workshop Floor">
                                厂房楼层</li>
                            <li class="ProductType" data-lang="ProductType" data_ch="产品类型" data_en="Product Type">
                                产品类型</li>
                            <li class="MachineCapacity" data-lang="MachineCapacity" data_ch="机台能力"
                                data_en="Machine Capacity">机台能力</li>
                            <li class="DocumentType" data-lang="DocumentType" data_ch="文档类型" data_en="Document Type">
                                文档类型</li>
                            <li class="FaultType" data-lang="FaultType" data_ch="设备类型" data_en="Fault Type">设备类型
                            </li>
                        </ul>

                        <!-- 下面切换的内容 -->
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show firstTable">
                                <!-- 查询组合 -->
                                <div class="btn-box layui-btn-container layui-row" style="text-align: left;">
                                    <div class="layui-col-sm12 layui-col-md12"
                                    style="display:inline-block;text-align: right;margin-bottom: 18px;">
                                    <button class="add-btn layui-col-sm6 layui-col-md6 add1">
                                        <i class="layui-icon layui-icon-add-circle"
                                            style="font-size: 15px; color: #1E9FFF;"></i>
                                        <span data-lang="newDeliveryRoomInformation">新增设备系列</span>
                                    </button>
                                    <span class="layui-title-screen">
                                        <div class="screen-btn">
                                            <form class="layui-form" action="">
                                                <input type="search" name="value"
                                                    class="inputQuery search-blank-inner searchInput"
                                                    placeholder="自定义搜索" style="left: 0;" autocomplete="off" />
                                                <button type="button" lay-submit lay-filter="query"
                                                    class="search search-blank-icon"></button>
                                            </form>
                                        </div>
                                    </span>
                                </div>
                                </div>
                                <!-- 第一个table   -->
                                <table id="equipmentSeries" lay-even lay-skin="nob" class="layui-table"
                                    lay-filter="equipmentSeries"></table>
                                    <div class="footer layui-btn-container">
                                        <button class="btn1 layui-btn layui-btn-radius layui-btn-primary del1">
                                            <i class="layui-icon layui-icon-delete"
                                                style="font-size: 15px; color: #FFF;"></i>
                                            <span data-lang="delete">删除</span>
                                        </button>
                                    </div>
                            </div>
                            <!-- 第二个 -->
                            <div class="Second layui-tab-item">
                                <div class="btn-box layui-btn-container layui-row" style="text-align: right;">
                                     <span class="layui-title-screen">
                                        <div class="screen-btn">
                                            <form class="layui-form" action="">
                                                <input type="search" name="value"
                                                    class="inputQuery search-blank-inner searchInput"
                                                    placeholder="搜索设备型号" style="left: 0;" autocomplete="off" />
                                                <button type="button" lay-submit lay-filter="query"
                                                    class="search search-blank-icon search_one"></button>
                                            </form>
                                        </div>
                                    </span>
                                </div>
                                <table id="equipmentModelSup" lay-even lay-skin="nob" class="layui-table" lay-filter="equipmentModelSup"></table>
                                <div class="layui-tab" lay-filter="my_tab">
                                    <ul class="layui-tab-title">
                                        <li class="layui-this">关联备件</li>
                                        <li>关联参数</li>
                                        <li>关联产品类型</li>
                                        <li>关联机台能力</li>
                                    </ul>
                                    <div class="layui-tab-content tab" >
                                        <div class="layui-tab-item layui-show one">
                                        <div class="btn-box layui-btn-container layui-row" style="text-align: right;">
                                            <button class="add-btn layui-col-sm6 layui-col-md6">
                                                <i class="layui-icon layui-icon-add-circle"
                                                    style="font-size: 15px; color: #1E9FFF;"></i>
                                                <span data-lang="newLink">新增关联</span>
                                            </button>
                                            <div class="layui-col-sm12 layui-col-md12"
                                                style="display:inline-block;padding-left: 10px;">
                                                <span class="layui-title-screen">
                                                    <div class="screen-btn">
                                                        <form class="layui-form" action="">
                                                            <input type="search" name="value" class="inputQuery my_ipt"
                                                                placeholder="搜索备品备件" autocomplete="off" style="left: 0;"/>
                                                                <button type="button" lay-submit lay-filter="query"
                                                                class="search search-blank-icon my_query"></button>
                                                        </form>
                                                    </div>
                                                </span>
                                            </div>
                                        </div>
                                        <table id="equipmentModelSub" lay-even lay-skin="nob" class="layui-table"
                                            lay-filter="equipmentModelSub"></table>
                                        <div class="footer layui-btn-container">
                                            <button class="btn1 layui-btn layui-btn-radius layui-btn-primary del1">
                                                <i class="layui-icon layui-icon-delete"
                                                    style="font-size: 15px; color: #FFF;"></i>
                                                <span data-lang="delete">删除</span>
                                            </button>
                                        </div>
                                        </div>
                                        <div class="layui-tab-item two">
                                            <div class="btn-box layui-btn-container layui-row" style="text-align: left;">
                                                <div class="layui-col-sm12 layui-col-md12"
                                                    style="display:inline-block;text-align: right;margin-bottom: 18px;">
                                                    <button class="add-btn layui-col-sm6 layui-col-md6 add3">
                                                        <i class="layui-icon layui-icon-add-circle"
                                                            style="font-size: 15px; color: #1E9FFF;"></i>
                                                        <span data-lang="NewProductTypes">关联设备参数</span>
                                                    </button>
                                                    <span class="layui-title-screen">
                                                        <div class="screen-btn">
                                                            <form class="layui-form" action="">
                                                                <input type="search" name="value"
                                                                    class="inputQuery search-blank-inner searchInput"
                                                                    placeholder="自定义搜索" style="left: 0;" autocomplete="off" />
                                                                <button type="button" lay-submit lay-filter="query"
                                                                    class="search search-blank-icon"></button>
                                                            </form>
                                                        </div>
                                                    </span>
                                                </div>
                                            </div>
                                            <table id="two" lay-even lay-skin="nob" class="layui-table"
                                                lay-filter="two"></table>
                                            <div class="footer layui-btn-container">
                                                <button class="btn1 layui-btn layui-btn-radius layui-btn-primary del_two">
                                                    <i class="layui-icon layui-icon-delete"
                                                        style="font-size: 15px; color: #FFF;"></i>
                                                    <span data-lang="delete">删除</span>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-tab-item three">
                                            <div class="btn-box layui-btn-container layui-row" style="text-align: left;">
                                                <div class="layui-col-sm12 layui-col-md12"
                                                    style="display:inline-block;text-align: right;margin-bottom: 18px;">
                                                    <button class="add-btn layui-col-sm6 layui-col-md6 add3">
                                                        <i class="layui-icon layui-icon-add-circle"
                                                            style="font-size: 15px; color: #1E9FFF;"></i>
                                                        <span data-lang="NewProductTypes">关联产品类型</span>
                                                    </button>
                                                    <span class="layui-title-screen">
                                                        <div class="screen-btn">
                                                            <form class="layui-form" action="">
                                                                <input type="search" name="value"
                                                                    class="inputQuery search-blank-inner searchInput"
                                                                    placeholder="自定义搜索" style="left: 0;" autocomplete="off" />
                                                                <button type="button" lay-submit lay-filter="query"
                                                                    class="search search-blank-icon"></button>
                                                            </form>
                                                        </div>
                                                    </span>
                                                </div>
                                            </div>
                                            <table id="three" lay-even lay-skin="nob" class="layui-table"
                                                lay-filter="three"></table>
                                            <div class="footer layui-btn-container">
                                                <button class="btn1 layui-btn layui-btn-radius layui-btn-primary del_three">
                                                    <i class="layui-icon layui-icon-delete"
                                                        style="font-size: 15px; color: #FFF;"></i>
                                                    <span data-lang="delete">删除</span>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-tab-item fore">
                                        <div class="btn-box layui-btn-container layui-row" style="text-align: left;">
                                            <div class="layui-col-sm12 layui-col-md12"
                                                style="display:inline-block;text-align: right;margin-bottom: 18px;">
                                                <button class="add-btn layui-col-sm6 layui-col-md6 add4">
                                                    <i class="layui-icon layui-icon-add-circle"
                                                        style="font-size: 15px; color: #1E9FFF;"></i>
                                                    <span data-lang="NewMachineCapacity">关联机台能力</span>
                                                </button>
                                                <span class="layui-title-screen">
                                                    <div class="screen-btn">
                                                        <form class="layui-form" action="">
                                                            <input type="search" name="value"
                                                                class="inputQuery search-blank-inner searchInput"
                                                                placeholder="自定义搜索" style="left: 0;" autocomplete="off" />
                                                            <button type="button" lay-submit lay-filter="query"
                                                                class="search search-blank-icon"></button>
                                                        </form>
                                                    </div>
                                                </span>
                                            </div>
                                        </div>
                                        <table id="fore" lay-even lay-skin="nob" class="layui-table"
                                            lay-filter="fore"></table>
        
                                        <div class="footer layui-btn-container">
                                            <button class="btn1 layui-btn layui-btn-radius layui-btn-primary del_fore">
                                                <i class="layui-icon layui-icon-delete"
                                                    style="font-size: 15px; color: #FFF;"></i>
                                                <span data-lang="delete">删除</span>
                                            </button>
                                        </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-tab-item thirdlyTable">
                                <div class="btn-box layui-btn-container layui-row" style="text-align: left;">
                                    <div class="layui-col-sm12 layui-col-md12"
                                        style="display:inline-block;text-align: right;margin-bottom: 18px;">
                                        <button class="add-btn layui-col-sm6 layui-col-md6 add1">
                                            <i class="layui-icon layui-icon-add-circle"
                                                style="font-size: 15px; color: #1E9FFF;"></i>
                                            <span data-lang="newDeliveryRoomInformation">新增厂房资料</span>
                                        </button>
                                        <span class="layui-title-screen">
                                            <div class="screen-btn">
                                                <form class="layui-form" action="">
                                                    <input type="search" name="value"
                                                        class="inputQuery search-blank-inner searchInput"
                                                        placeholder="自定义搜索" style="left: 0;" autocomplete="off" />
                                                    <button type="button" lay-submit lay-filter="query"
                                                        class="search search-blank-icon"></button>
                                                </form>
                                            </div>
                                        </span>
                                    </div>
                                </div>
                                <table id="workshopInformation" lay-even lay-skin="nob" class="layui-table"
                                    lay-filter="workshopInformation"></table>
                                <!-- 第三个切换的表格 -->
                                <div class="footer layui-btn-container">
                                    <button class="btn1 layui-btn layui-btn-radius layui-btn-primary del1">
                                        <i class="layui-icon layui-icon-delete"
                                            style="font-size: 15px; color: #FFF;"></i>
                                        <span data-lang="delete">删除</span>
                                    </button>
                                </div>

                            </div>
                            <div class="layui-tab-item fourthTable">
                                <div class="btn-box layui-btn-container layui-row" style="text-align: left;">
                                    <div class="layui-col-sm12 layui-col-md12"
                                        style="display:inline-block;text-align: right;margin-bottom: 18px;">
                                         <button class="add-btn layui-col-sm6 layui-col-md6 add2">
                                            <i class="layui-icon layui-icon-add-circle"
                                                style="font-size: 15px; color: #1E9FFF;"></i>
                                            <span data-lang="NewFloorOfDeliveryRoom">新增厂房楼层</span>
                                         </button>
                                        <span class="layui-title-screen">
                                            <div class="screen-btn">
                                                <form class="layui-form" action="">
                                                    <input type="search" name="value"
                                                        class="inputQuery search-blank-inner searchInput"
                                                        placeholder="自定义搜索" style="left: 0;" autocomplete="off" />
                                                    <button type="button" lay-submit lay-filter="query"
                                                        class="search search-blank-icon"></button>
                                                </form>
                                            </div>
                                        </span>
                                    </div>
                                </div>
                                <table id="workshopStorey" lay-even lay-skin="nob" class="layui-table"
                                    lay-filter="workshopStorey"></table>
                                <div class="footer layui-btn-container">
                                    <button class="btn1 layui-btn layui-btn-radius layui-btn-primary del2">
                                        <i class="layui-icon layui-icon-delete"
                                            style="font-size: 15px; color: #FFF;"></i>
                                        <span data-lang="delete">删除</span>
                                    </button>
                                </div>

                            </div>
                            <div class="layui-tab-item fiveTable">
                                <div class="btn-box layui-btn-container layui-row" style="text-align: left;">
                                    <div class="layui-col-sm12 layui-col-md12"
                                        style="display:inline-block;text-align: right;margin-bottom: 18px;">
                                        <button class="add-btn layui-col-sm6 layui-col-md6 add3">
                                            <i class="layui-icon layui-icon-add-circle"
                                                style="font-size: 15px; color: #1E9FFF;"></i>
                                            <span data-lang="NewProductTypes">新增产品类型</span>
                                        </button>
                                        <span class="layui-title-screen">
                                            <div class="screen-btn">
                                                <form class="layui-form" action="">
                                                    <input type="search" name="value"
                                                        class="inputQuery search-blank-inner searchInput"
                                                        placeholder="自定义搜索" style="left: 0;" autocomplete="off" />
                                                    <button type="button" lay-submit lay-filter="query"
                                                        class="search search-blank-icon"></button>
                                                </form>
                                            </div>
                                        </span>
                                    </div>
                                </div>
                                <table id="productType" lay-even lay-skin="nob" class="layui-table"
                                    lay-filter="productType"></table>

                                <div class="footer layui-btn-container">
                                    <button class="btn1 layui-btn layui-btn-radius layui-btn-primary del3">
                                        <i class="layui-icon layui-icon-delete"
                                            style="font-size: 15px; color: #FFF;"></i>
                                        <span data-lang="delete">删除</span>
                                    </button>
                                </div>
                            </div>
                            <div class="layui-tab-item sexTable">
                                <div class="btn-box layui-btn-container layui-row" style="text-align: left;">
                                    <div class="layui-col-sm12 layui-col-md12"
                                        style="display:inline-block;text-align: right;margin-bottom: 18px;">
                                        <button class="add-btn layui-col-sm6 layui-col-md6 add4">
                                            <i class="layui-icon layui-icon-add-circle"
                                                style="font-size: 15px; color: #1E9FFF;"></i>
                                            <span data-lang="NewMachineCapacity">新增机台能力</span>
                                        </button>
                                        <span class="layui-title-screen">
                                            <div class="screen-btn">
                                                <form class="layui-form" action="">
                                                    <input type="search" name="value"
                                                        class="inputQuery search-blank-inner searchInput"
                                                        placeholder="自定义搜索" style="left: 0;" autocomplete="off" />
                                                    <button type="button" lay-submit lay-filter="query"
                                                        class="search search-blank-icon"></button>
                                                </form>
                                            </div>
                                        </span>
                                    </div>
                                </div>
                                <table id="machineAbility" lay-even lay-skin="nob" class="layui-table"
                                    lay-filter="machineAbility"></table>

                                <div class="footer layui-btn-container">
                                    <button class="btn1 layui-btn layui-btn-radius layui-btn-primary del4">
                                        <i class="layui-icon layui-icon-delete"
                                            style="font-size: 15px; color: #FFF;"></i>
                                        <span data-lang="delete">删除</span>
                                    </button>
                                </div>
                            </div>
                            <div class="layui-tab-item seventhTable">
                                <div class="btn-box layui-btn-container layui-row" style="text-align: left;">
                                    <div class="layui-col-sm12 layui-col-md12"
                                        style="display:inline-block;text-align: right;margin-bottom: 18px;">
                                        <button class="add-btn layui-col-sm6 layui-col-md6 add5">
                                                <i class="layui-icon layui-icon-add-circle"
                                                    style="font-size: 15px; color: #1E9FFF;"></i>
                                                <span data-lang="NewDocumentType">新增文档类型</span>
                                              </button>
                                        <span class="layui-title-screen">   
                                            <div class="screen-btn">
                                                <form class="layui-form" action="">
                                                    <input type="search" name="param"
                                                        class="inputQuery search-blank-inner searchInput"
                                                        placeholder="自定义搜索" style="left: 0;" autocomplete="off" />
                                                    <button type="button" lay-submit lay-filter="query"
                                                        class="search search-blank-icon"></button>
                                                </form>
                                            </div>
                                        </span>
                                    </div>
                                </div>
                                <table id="documentType" lay-even lay-skin="nob" class="layui-table"
                                    lay-filter="documentType"></table>
                            </div>
                            <div class="layui-tab-item eighthTable">
                                <div class="btn-box layui-btn-container layui-row" style="text-align: left;">
                                    <div class="layui-col-sm12 layui-col-md12"
                                        style="display:inline-block;text-align: right;margin-bottom: 18px;">
                                        <button class="add-btn layui-col-sm6 layui-col-md6 add6">
                                            <i class="layui-icon layui-icon-add-circle"
                                                style="font-size: 15px; color: #1E9FFF;"></i>
                                            <span data-lang="NewDeviceType">新增设备类型</span>
                                        </button>
                                        <span class="layui-title-screen">
                                            <div class="screen-btn">
                                                <form class="layui-form" action="">
                                                    <input type="search" name="value"
                                                        class="inputQuery search-blank-inner searchInput"
                                                        placeholder="自定义搜索" style="left: 0;" autocomplete="off" />
                                                    <button type="button" lay-submit lay-filter="query"
                                                        class="search search-blank-icon"></button>
                                                </form>
                                            </div>
                                        </span>
                                    </div>
                                </div>
                                <table id="equipmentType" lay-even lay-skin="nob" class="layui-table"
                                    lay-filter="equipmentType"></table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script>
            var fii02
        layui.use(['table', 'admin', 'laypage', 'jquery', 'laytpl', 'tree', 'form', 'api', 'view', 'laydate', 'setter', 'treeSelect','element','utill'], function () {
        var form = layui.form;
        var table = layui.table;
        var admin = layui.admin;
        var laypage = layui.laypage;
        var $ = layui.jquery;
        var laytpl = layui.laytpl;
        var tree = layui.tree;
        var api = layui.api;
        var view = layui.view;
        var laydate = layui.laydate;
        var setter = layui.setter;
        var treeSelect = layui.treeSelect;
        var utill = layui.utill;
        var element = layui.element;
        // 点击颜色
        table.on('row(equipmentModelSup)', function(obj){
            $(".layui-table-body tr:nth-child(even)").attr({"style":"background:#ccdae3"});
            $(".layui-table-body tr:nth-child(odd)").attr({"style":"background:#FFFFFF"});
            $(obj.tr.selector).attr({"style":"background:#999999"});//改变当前tr颜色
     
        });
        table.on('tool(equipmentModelSup)', function(obj,fii02){
            fii02 = obj.data.fii02;
            sessionStorage.setItem('fii02',JSON.stringify(fii02));
            if(fii02 != null){
                table_six_one({fii02})
                table_t_two(fii02);
                table_five_one({fii02})
            }
            // 产品类型
            $('.three').on('click', '.search', function () {
                var value = $('.three form').find('input').val()
                return table_five({keyWord:value});
            })

        });
        element.on('tab(my_tab)', function(data){
            let fii02 = JSON.parse(sessionStorage.getItem('fii02'));
                if(data.index == 1){
                    canshu({fii02})
                    $('.two').on('click', '.del_two', function (){
                        let checked = table.checkStatus('#two').data;
                        if(checked.length == 0){
                            layer.open({
                                content: '请选择要删除的关联设备参数！'
                            })
                        }else{
                            let list = [];
                            checked.forEach((elem,index)=>{
                                list.push(elem.tcParId)
                            });
                            del('#two',JSON.stringify({id:list}),'POST','/parameter/delParameter.json');
                        }
                    });
                    $('.two').on('click', '.search', function(){
                        var value = $('.two form').find('input').val()
                            return  canshu({keyWord:value,fii02:fii02});
                    })
                    utill.alert({
                        then:function(obj){
                            let fii02 = JSON.parse(sessionStorage.getItem('fii02'));
                            if(fii02){
                                $('[name="tcParFii02"]').attr('disabled','disabled');
                                $('[name="tcParFii02"]').css('border','0')
                                form.val('myform',{
                                    'tcParFii02': fii02
                                });
                            };
                        },
                        done:function(res){
                            utill.submit('/parameter/insertParameter.json',res,'#two');
                            layer.closeAll();
                        }
                    },'.two','新增设备参数关联',['392px','300px'],'home/popup/canshu','.btn2');
                }else if(data.index == 2){
                    table_five_one({fii02})
                    //批量删除
                    $('.three').on('click', '.del_three', function (){
                        let checked = table.checkStatus('#three').data;
                        if(checked.length == 0){
                            layer.open({
                                content: '请选择要删除的关联产品类型！'
                            })
                        }else{
                            let list = [];
                            checked.forEach((elem,index)=>{
                                list.push(elem.tcProdId)
                            });
                            del('#three',JSON.stringify({fii02:fii02,tcProdProdId:list}),'POST','/TcEamDevProduct/delTcEamDevProduct.json');
                        }
                    });
                    $('.three').on('click', '.search', function(){
                        var value = $('.three form').find('input').val()
                            return  table_five_one({keyWord:value,fii02:fii02});
                    })
                    utill.alert({
                        then:function(obj){
                            let fii02 = JSON.parse(sessionStorage.getItem('fii02'));
                            $('#tcProdCode_title').html('<span style="font-size: 18px;color: red;position: relative;display: inline-block;line-height: 20px;vertical-align: middle;top:3px;">*</span>产品类型ID：');
                            let html =    `<div class="layui-form-item">
                                        <label class="layui-form-label">
                                            <span style="font-size: 18px;color: red;position: relative;display: inline-block;line-height: 20px;vertical-align: middle;top:3px;">*</span>
                                            设备型号：
                                        </label>
                                        <div class="layui-input-block">
                                            <input type="text" name="tcProdFii02" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input" id="title">
                                        </div>
                                    </div>`;
                            $('.row').prepend(html);
                            $('[name="tcProdName"]').css('border','0');   
                            $('[name="tcProdDsc"]').css('border','0'); 
                            $('[name="tcProdName"]').attr('disabled','disabled');    
                            $('[name="tcProdDsc"]').attr('disabled','disabled');   
                            if(fii02){
                                $('#title').css('border','0');     
                                $('#title').attr('disabled','disabled');    
                                form.val('form',{
                                    'tcProdFii02': fii02
                                });
                            }
                            utill.fuzzmatch('#tcProdCode', {
                                isShowValue: false,
                                reqObj: {
                                    url: api.host + '/fia/selectDevProduct.json',
                                    type: 'POST',
                                    dataType: 'json',
                                    contentType: 'application/json',
                                    data:JSON.stringify({
                                        fii05:$('#title').val(),
                                        pageNum: 1,
                                        pageSize: 10000
                                    }),
                                },
                                dataTrans: function (res) {
                                    return res.data.list.map((item) => {
                                        return {
                                            label: item.tcProdId,
                                            value: item.tcProdCode,
                                            data:item
                                        }
                                    })
                                },
                                done:function(res){
                                    form.val('form',{
                                        'tcProdName': res.data.tcProdName,
                                        'tcProdDsc': res.data.tcProdDsc
                                    })
                                }
                            });
                        },
                        done:function(res){
                            res.tcProdProdid = res.tcProdCode 
                            delete res.tcProdCode
                            delete res.tcProdDsc
                            delete res.tcProdName
                            utill.submit('/TcEamDevProduct/insertTcEamDevProduct.json',res,'#three','POST');
                            layer.closeAll();
                        }
                    },'.three','新增产品类型关联',['392px','300px'],'home/popup/productType','.btn2');
                }else if(data.index == 3){
                    table_six_one({fii02})
                    //批量删除
                    $('.fore').on('click', '.del_fore', function (){
                        let checked = table.checkStatus('#fore').data;
                        if(checked.length == 0){
                            layer.open({
                                content: '请选择要删除的关联机台能力！'
                            })
                        }else{
                            let list = [];
                            checked.forEach((elem,index)=>{
                                list.push(elem.tcCapId)
                            });
                            del('#fore',JSON.stringify({fii02:fii02,tcCapCapid:list}),'POST','/TcEamDevsCapacity/delTcEamDevsCapacity.json');
                        }
                        
                    });
                    $('.fore').on('click', '.search', function(){
                        var value = $('.fore form').find('input').val()
                            return  table_six_one({keyWord:value,fii02:fii02});
                    })
                    utill.alert({
                        then:function(obj){
                            let fii02 = JSON.parse(sessionStorage.getItem('fii02'));
                            $('#tcCapCode').html('<span style="font-size: 18px;color: red;position: relative;display: inline-block;line-height: 20px;vertical-align: middle;top:3px;">*</span>机台能力ID：');
                            let html =    `<div class="layui-form-item">
                                        <label class="layui-form-label">
                                            <span style="font-size: 18px;color: red;position: relative;display: inline-block;line-height: 20px;vertical-align: middle;top:3px;">*</span>
                                            设备型号：
                                        </label>
                                        <div class="layui-input-block">
                                            <input type="text" name="tcCapFii02" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input" id="tcCapFii02">
                                        </div>
                                    </div>`;
                                $('.row').prepend(html);
                            if(fii02){
                                $('#tcCapFii02').css('border','0');     
                                $('#tcCapFii02').attr('disabled','disabled');    
                                form.val('form',{
                                    'tcCapFii02': fii02
                                });
                            }
                            $('[name="tcCapName"]').css('border','0');    
                            $('[name="tcCapDsc"]').css('border','0');
                            $('[name="tcCapDsc"]').attr('disabled','disabled')
                            $('[name="tcCapName"]').attr('disabled','disabled')
                            utill.fuzzmatch('#tcCapFii02', {
                                isShowValue: false,
                                reqObj: {
                                    url: api.host + '/fil/querySelectFiiFileList.json',
                                    type: 'POST',
                                    dataType: 'json',
                                    contentType: 'application/json',
                                    data:JSON.stringify({
                                        fii05:$('#tcCapFii02').val(),
                                        pageNum: 1,
                                        pageSize: 10000
                                    }),
                                },
                                dataTrans: function (res) {
                                    return res.data.list.map((item) => {
                                        return {
                                            label: item.fii02,
                                            value: item.fii02,
                                            data: item
                                        }
                                    })
                                }
                            });
                            utill.fuzzmatch('#title_id', {
                                isShowValue: false,
                                reqObj: {
                                    url: api.host + '/fia/selectDevCapaCity.json',
                                    type: 'POST',
                                    dataType: 'json',
                                    contentType: 'application/json',
                                    data:JSON.stringify({
                                        keyWord:$('#title_id').val(),
                                        pageNum: 1,
                                        pageSize: 10000
                                    }),
                                },
                                dataTrans: function (res) {
                                    return res.data.list.map((item) => {
                                        return {
                                            label: item.tcCapId,
                                            value: item.tcCapId,
                                            data: item
                                        }
                                    })
                                },
                                done:function(res){
                                    form.val('form',{
                                        'tcCapName': res.data.tcCapName,
                                        'tcCapDsc': res.data.tcCapDsc
                                    })
                                }
                            });
                        },
                        done:function(res){
                            res.tcCapCapid = res.tcCapCode
                            delete res.tcCapCode
                            delete res.tcCapDsc
                            delete res.tcCapName
                            utill.submit('/TcEamDevsCapacity/insertTcEamDevsCapacity.json',res,'#fore');
                            layer.closeAll();
                        }
                    },'.fore','新增关联机台能力',['392px','300px'],'home/popup/machineAbility','.btn2');
                }
            

        })
        $('.search-blank-inner').focus(function () {
            $('.searchInput').css('width', '100px')
        });
        $('.search-blank-inner').blur(function () {
            $('.searchInput').css('width', '65px')
        });
        $('.my_ipt').focus(function () {
            $(this).css('width', '100px')
        });
        $('.my_ipt').blur(function () {
            $(this).css('width', '65px')
        });
        function del(table,data,type,url){
            if(data == '[]'){
                return layer.open({content:'请选择要删除的数据！'});
            }else{
                layer.confirm('确定删除吗', ()=>{
                admin.req({
                    type: type,
                    url: api.host + url,
                    dataType: 'json',
                    contentType: "application/json",
                    data:data,
                    success: function (data) {
                        if(data.code == 0){
                            layer.msg(data.message);
                            layui.table.reload(table)
                        }
                    },
                    error:function(data){
                        layer.msg(data.message);
                        layui.table.reload(table)
                    }
                }) 
            })
            }  
            
        }
        //关联设备参数
        function canshu(data){
            utill.columnCustom('#two', "FiaFileParametersVO", {
                url: api.host + '/parameter/selectParameter1.json',
                where: {
                    keyWord: data.keyWord,
                    fii02:data.fii02 == null?'':data.fii02
                }
            });
        }
         //关联产品类型
         function table_five_one(data){
            utill.columnCustom('#three', "FiaFileDevProductVO", {
                url: api.host + '/TcEamDevProduct/selectTcEamDevProduct.json',
                where: {
                    keyWord: data.keyWord,
                    fii02:data.fii02 == null? '': data.fii02
                }
            });
        }
          //关联机台能力
          function table_six_one(data){
            utill.columnCustom('#fore', "FiaFileCapVO", {
                url: api.host + '/TcEamDevsCapacity/selectTcEamDevsCapacity.json',
                where: {
                    keyWord: data.keyWord,
                    fii02:data.fii02 == null? '': data.fii02
                }
            });
        }
        //设备系列
        function table_one(data){
            utill.columnCustom('#equipmentSeries', "TcEamDevSeriesVO", {
                url: api.host + '/fia/selectByKey.json',
                where:{
                    value:data
                },
                toolbar: {
                    toolbar: '#onlyDelEdit',
                    title: '操作',
                    event: 'detail',
                    align: 'center'
                }
            });
        }
        //设备型号
        function table_two(data){
            utill.columnCustom('#equipmentModelSup', "FiiFileVO", {
                url: api.host + '/fil/querySelectFiiFileList.json',
                where: {
                    value: data
                },
                checkbox: false
            });
        }
        function table_t_two(data){
            if(data){
                utill.columnCustom('#equipmentModelSub', "QuerySparePartsVO", {
                    url: api.host + '/fil/QuerySpareParts.json',
                    where: {
                        fii02: data?data:-1
                    },
                });
                let res = data;
                
            $('.layui-layout-body').on('click', '.my_query',function(){
            var value = $('.Second form').find('.my_ipt').val()
                utill.columnCustom('#equipmentModelSub', "QuerySparePartsVO", {
                    url: api.host + '/fil/QuerySpareParts.json',
                    where: {
                        fii02: res,
                        value: value
                    },
                });
            })
            }
            return data;
        }
        //厂房资料
        function table_three(data){
            utill.columnCustom('#workshopInformation', "TcEamDevFactoryVO", {
                url: api.host + '/tcEamFactory/selectDevFactory.json',
                where: {
                    value: data
                },
                toolbar: {
                    toolbar: '#onlyDel',
                    title: '操作',
                    event: 'detail',
                    align: 'center'
                }
            });
        }
        //厂房楼层
        function table_fore(data){
            utill.columnCustom('#workshopStorey', "TcEamDevFtyFloorVO", {
                url: api.host + '/tcEamDevFtyFactory/selectFtyFloor.json',
                where: {
                    value: data
                },
                toolbar: {
                    toolbar: '#onlyDel',
                    title: '操作',
                    event: 'detail',
                    align: 'center'
                }
            });
        }
        //产品类型
          function table_five(data){
            utill.columnCustom('#productType', "FiaFileDevProductVO", {
                url: api.host + '/fia/selectDevProduct.json',
                where: {
                    value: data
                },
                toolbar: {
                    toolbar: '#onlyDelEdit',
                    title: '操作',
                    event: 'detail',
                    align: 'center'
                }
            });
        }
         //机台能力
         function table_six(data){
            utill.columnCustom('#machineAbility', "FiaFileCapVO", {
                url: api.host + '/fia/selectDevCapaCity.json',
                where: {
                    value: data
                },
                toolbar: {
                    toolbar: '#onlyDelEdit',
                    title: '操作',
                    event: 'detail',
                    align: 'center'
                }
            });
        }
       
        //文档类型
        function table_seven(data){
            utill.columnCustom('#documentType', "TcEamDocCategory", {
                url: api.host + '/do/selectCatgList.json',
                where: {
                    param: data
                },
                checkbox: false,
                toolbar: {
                    toolbar: '#onlyDelEdit',
                    title: '操作',
                    event: 'detail',
                    align: 'center'
                }
            });
        }
          //设备类型
          function table_eight(data){
            utill.columnCustom('#equipmentType', "FicFileVO", {
                url: api.host + '/fil/querySelectFicFileList.json',
                where: {
                    value: data
                },
                checkbox: false,
                toolbar: {
                    toolbar: '#onlyDelEdit',
                    title: '操作',
                    event: 'detail',
                    align: 'center'
                }
            });
        }
        //监听点击事件
        
        //回车搜索
        utill.keyup('.searchInput', '.search_one');
        utill.keyup('.searchInput', '.search-blank-icon');
        // utill.keyup('.my_ipt', '.my_query');
        utill.keyup('.my_ipt', '.search-blank-icon');
        //按钮权限控制
        utill.showAndHide('.add1,.del1','TcEamFactoryController:addFactory');
        utill.showAndHide('.add2,.del2','TcEamFactoryController:addFactory');
        utill.showAndHide('.add3,.del3','FiaFileController:insertDevProduct');
        utill.showAndHide('.add4,.del4','FiaFileController:insertDevCapaCity');
        //每个搜索按钮绑定对应表格
        table_one()
         //设备系列
         $('.firstTable').on('click', '.search', function () {
            var value = $('.firstTable form').find('input').val()
            return table_one(value);
        });
        table.on('tool(equipmentSeries)', function(obj){
            let list = {tcSeriesId:[
                obj.data.tcSeriesId
            ]};
            if(obj.event == 'del'){
                del('#equipmentSeries',JSON.stringify(list),'POST','/fil/deleteDevSeries.json');
            }else if(obj.event == 'edit'){
                utill.myalert('设备系列编辑',['392px','400px'],'home/popup/equipmentType','.btn2',{
                    then:function(obj){
                        $("[name='tcSeriesCode']").attr('disabled','disabled');
                        $("[name='tcSeriesCode']").css('border','0px');
                        $("[name='tcSeriesCode']").val(obj.tcSeriesCode);
                        $("[name='tcSeriesName']").val(obj.tcSeriesName);
                        $("[name='tcSeriesDsc']").val(obj.tcSeriesDsc);
                        $("[name='tcSeriesPmc01']").val(obj.pmc03);
                        $("[name='tcSeriesPmc01']").data('id',obj.tcSeriesPmc01);
                    },done:function(res,obj){
                        res.tcSeriesPmc01 = $('#tcSeriesPmc01').data('id');
                        utill.submit('/fil/updateDevSeries.json',res,'#equipmentSeries');
                        layer.closeAll();
                    }
                },obj.data,'submit1');
            }
        })
        utill.alert({
            click_done:function(){
                sessionStorage.removeItem('pmc01')
                $('#tcSeriesPmc01').empty();
                $('#tcSeriesPmc01').data('id','');
            },
            done:function(res){
                res.tcSeriesPmc01 = $('#tcSeriesPmc01').data('id');
                utill.submit('/fil/insertDevSeries.json',res,'#equipmentSeries');
                layer.closeAll();
            }
        },'.firstTable','新增设备系列',['392px','400px'],'home/popup/equipmentType','.btn2','submit1');
        $('.firstTable').on('click', '.btn1', function (){
            let checked = table.checkStatus('#equipmentSeries').data;
            let list = {tcSeriesId:[]};
            checked.forEach((elem,index)=>{
                list.tcSeriesId.push(elem.tcSeriesId)
            });
            del('#equipmentSeries',JSON.stringify(list),'POST','/fil/deleteDevSeries.json');
        });
       
        
        //监听tab切换加载表格并监听对应的搜索
        element.on('tab(filter)', function(data){
            if(data.index == 1){
                table_two()
                //设备型号
                $('.Second').on('click', '.search_one', function () {
                var value = $('.Second form').find('input').val()
                    return table_two(value)
                });
                    utill.alert({
                    then:function(obj){
                        let fii02 = JSON.parse(sessionStorage.getItem('fii02'));
                        if(fii02){
                            admin.req({
                            url: api.host + '/fil/querySelectFiiFileList.json',
                            type: 'POST',
                            dataType: 'json',
                            contentType: 'application/json',
                            data:JSON.stringify({
                                fii05:$('#title1').val(),
                                pageNum: 1,
                                pageSize: 10000
                            }),
                            success: function (data) {
                                let res = data.data.list;
                                res.forEach((item,index)=>{
                                    if(fii02 != undefined && item.fii02 == fii02){
                                        form.val("alert_formOne",{
                                            'fii02': item.fii02,
                                            'fii01': item.fii01,
                                            'tcSeriesPmc01': item.tcSeriesPmc01,
                                            'fii03': item.fii03
                                        });
                                        $('[name="fii02"]').attr('disabled','disabled');
                                        $('[name="fii02"]').css('border','0');
                                    }
                                })
                            }
                        })
                        }
                    },
                    done:function(res){
                        let data = {
                            fii02:res.fii02,
                            ima01:res.ima01
                        };
                        utill.submit('/fil/insertTcEamSpDev.json',data,'equipmentModelSub');
                        table_t_two(res.fii02)
                        layer.closeAll();
                    }
                },'.Second','新增备品备件关联',['392px','430px'],'home/popup/bpbj','.btn2');
                $('.Second').on('click', '.del1', function (){
                    let checked = table.checkStatus('#equipmentModelSub').data;
                    if(checked.length == 0){
                        layer.open({
                            content: '请选择要删除的关联备件！'
                        })
                    }else{
                        let ima01 = [];
                        checked.forEach((elem,index)=>{
                            ima01.push(elem.ima01)
                        });
                        del('#equipmentModelSub',JSON.stringify({fii02,ima01}),'POST','/fil/deleteTcEamSpDev.json');
                    }
                   
                });
            }else if(data.index == 2){
                table_three()
                 // 厂房资料
                $('.thirdlyTable').on('click', '.search', function () {
                    var value = $('.thirdlyTable form').find('input').val()
                    return table_three(value);
                });
                $('.thirdlyTable').on('click', '.btn1', function (){
                    let checked = table.checkStatus('#workshopInformation').data;
                    let list = [];
                    checked.forEach((elem,index)=>{
                        list.push(elem.tcFtyId)
                    });
                    del('#workshopInformation',JSON.stringify(list),'POST','/tcEamFactory/deleteFactory.json');
                });
                table.on('tool(workshopInformation)', function(obj){
                    let list = [
                     obj.data.tcFtyId
                    ]
                    if(obj.event == 'del'){
                        del('#workshopInformation',JSON.stringify(list),'POST','/tcEamFactory/deleteFactory.json');
                    }
                });
                utill.alert({
                    done:function(res){
                        let data = res;
                        data.tcFtyCoid = $('#tcFtyCoid').data('id');
                        utill.submit('/tcEamFactory/addFactory.json',data,'#workshopInformation');
                        layer.closeAll();
                    }
                },'.thirdlyTable','新增厂房资料',['392px','400px'],'home/popup/workshopInformation','.btn2');
            }else if(data.index == 3){
                table_fore()
                // 厂房楼层
                $('.fourthTable').on('click', '.search', function () {
                    var value = $('.fourthTable form').find('input').val()
                    return table_fore(value);
                });
                $('.fourthTable').on('click', '.btn1', function (){
                    let checked = table.checkStatus('#workshopStorey').data;
                    let list = [];
                    checked.forEach((elem,index)=>{
                        list.push(elem.tcFlrId)
                    });
                    del('#workshopStorey',JSON.stringify(list),'POST','/tcEamDevFtyFactory/deleteFloor.json');
                });
                table.on('tool(workshopStorey)', function(obj){
                    let list = [
                     obj.data.tcFlrId
                    ]
                    if(obj.event == 'del'){
                        del('#workshopStorey',JSON.stringify(list),'POST','/tcEamDevFtyFactory/deleteFloor.json');
                    }
                })
                utill.alert({
                    done:function(res){
                        let data = res;
                        data.tcFlrFtyid = $('#tcFlrFtyid').data('id');
                        utill.submit('/tcEamDevFtyFactory/addFloor.json',data,'#workshopInformation');
                        layer.closeAll();
                    }
                },'.fourthTable','新增厂房楼层',['392px','400px'],'home/popup/workshopStorey','.btn2');
            }else if(data.index == 4){
                table_five()
                // 产品类型
                $('.fiveTable').on('click', '.search', function () {
                    var value = $('.fiveTable form').find('input').val()
                    return table_five(value);
                })
                //批量删除
                $('.fiveTable').on('click', '.btn1', function (){
                    let checked = table.checkStatus('#productType').data;
                    let list = [];
                    checked.forEach((elem,index)=>{
                        list.push(elem.tcProdId)
                    });
                    del('#productType',JSON.stringify(list),'POST','/fia/deleteDevProduct.json');
                });
                 //表格内删除
                table.on('tool(productType)', function(obj){
                    let list = [
                     obj.data.tcProdId
                    ]
                    if(obj.event == 'del'){
                        del('#productType',JSON.stringify(list),'POST','/fia/deleteDevProduct.json');
                    }else if(obj.event == 'edit'){
                        utill.myalert('产品类型编辑',['392px','260px'],'home/popup/productType','.btn2',{
                            then:function(obj){
                                $("[name='tcProdCode']").attr('value',obj.tcProdCode);
                                $("[name='tcProdName']").attr('value',obj.tcProdName);
                                $("[name='tcProdDsc']").attr('value',obj.tcProdDsc);
                            },done:function(res,obj){
                                let data = res;
                                data.tcProdId = obj.tcProdId;
                                utill.submit('/fia/updateDevProduct.json',data,'#productType');
                                layer.closeAll();
                            }
                        },obj.data);
                        }
                })
                utill.alert({
                    done:function(res){
                        utill.submit('/fia/insertDevProduct.json',res,'#productType');
                        layer.closeAll();
                    }
                },'.fiveTable','新增产品类型',['392px','260px'],'home/popup/productType','.btn2');
            }else if(data.index == 5){
                table_six()
                 // 机台能力
                 $('.sexTable').on('click', '.search', function(){
                    var value = $('.sexTable form').find('input').val()
                    return table_six(value);
                })
                 //批量删除
                 $('.sexTable').on('click', '.btn1', function (){
                    let checked = table.checkStatus('#machineAbility').data;
                    let list = [];
                    checked.forEach((elem,index)=>{
                        list.push(elem.tcCapId)
                    });
                    del('#machineAbility',JSON.stringify(list),'POST','/fia/deleteDevCapaCity.json');
                });
                 //表格内删除
                 table.on('tool(machineAbility)', function(obj){
                    let list = [
                     obj.data.tcCapId
                    ]
                    if(obj.event == 'del'){
                        del('#machineAbility',JSON.stringify(list),'POST','/fia/deleteDevCapaCity.json');
                    }else if(obj.event == 'edit'){
                        utill.myalert('机台能力编辑',['392px','260px'],'home/popup/machineAbility','.btn2',{
                            then:function(obj){
                                $("[name='tcCapCode']").attr('value',obj.tcCapCode);
                                $("[name='tcCapName']").attr('value',obj.tcCapName);
                                $("[name='tcCapDsc']").attr('value',obj.tcCapDsc);
                            },done:function(res,obj){
                                let data = res;
                                data.tcCapId = obj.tcCapId;
                                utill.submit('/fia/updateDevCapaCity.json',data,'#machineAbility');
                                layer.closeAll();
                            }
                        },obj.data);
                    }
                })
                utill.alert({
                    done:function(res){
                        utill.submit('/fia/insertDevCapaCity.json',res,'#machineAbility');
                        layer.closeAll();
                    }
                },'.sexTable','新增机台能力',['392px','260px'],'home/popup/machineAbility','.btn2');
            }else if(data.index == 6){
                table_seven()
                 // 文档类型
                 $('.seventhTable').on('click', '.search', function () {
                    var param = $('.seventhTable form').find('input').val()
                    return table_seven(param);
                });
                 //表格内删除
                 table.on('tool(documentType)', function(obj){
                    let list = {id:obj.data.tcCatgId}
                    if(obj.event == 'del'){
                        del('#documentType',JSON.stringify(list),'POST',api.deleteCategory);
                    }else if(obj.event == 'edit'){
                        utill.myalert('文档类型编辑',['392px','420px'],'home/popup/documentType','.btn2',{
                            then:function(obj){
                                $('#tcCatgSupid').attr('disabled','disabled');
                                $('#tcCatgSupid').css('border','0px');
                                $("[name='tcCatgCode']").attr('value',obj.tcCatgCode);
                                $('#tcCatgName').attr('value',obj.tcCatgSupName);
                                $("[name='tcCatgName']").attr('value',obj.tcCatgName);
                                $("[name='tcCatgId']").attr('value',obj.tcCatgId);
                                $("[name='tcCatgDsc']").attr('value',obj.tcCatgDsc);
                                $("[name='tcCatgLevel']").attr('value',obj.tcCatgLevel);
                                $("[name='tcCatgSupid']").attr('value',obj.tcCatgSupName);
                                $('#tcCatgSupid').attr('value',obj.tcCatgSupName);
                            },done:function(res,obj){
                                let data = {};
                                data.tcCatgName = res.tcCatgName
                                data.tcCatgId = obj.tcCatgId;
                                data.tcCatgDsc = res.tcCatgDsc;
                                utill.submit('/do/updateCategory.json',data,'#documentType');
                                layer.closeAll();
                            }
                        },obj.data);
                    }
                })
                utill.alert({
                    then:function(obj){
                        admin.req({
                            url: api.host + '/do/selectOption.json',
                            type: 'get',
                            done: function (res) {
                                function transferKey(odata) {
                                    odata.forEach(obj => {
                                        obj.title = obj.tcCatgName
                                        obj.children = obj.childList
                                        delete obj["gem02"]
                                        delete obj["deptVOS"]
                                        if (obj.children instanceof Array) {
                                            transferKey(obj.children)
                                        }
                                    })
                                    return odata
                                }
                                odataArr = transferKey(res.data)
                                treeSelect.render({
                                    elem: "#tcCatgSupid",
                                    node: odataArr,
                                    done: (data) => {
                                        $("#tcCatgSupid").val(data.data.tcCatgName);
                                        $("[name='tcCatgSupid']").attr('value',data.data.tcCatgId);
                                    }
                                })

                            }
                    });
                    },
                    done:function(res){
                        let data = res;
                        utill.submit('/do/selectSeries.json',data,'#documentType');
                        layer.closeAll();
                    }
                },'.seventhTable','新增文档类型',['392px','420px'],'home/popup/documentType','.btn2');
            }else if(data.index == 7){
                table_eight()
                 // 设备类型
                 $('.eighthTable').on('click', '.search', function () {
                    var value = $('.eighthTable form').find('input').val()
                    return table_eight(value);
                })
                 //表格内删除
                 table.on('tool(equipmentType)', function(obj){
                    let list = obj.data.fic01;
                    if(obj.event == 'del'){
                        // 修改过的地方
                        del('#equipmentType',JSON.stringify({fic01:list}),'POST','/fil/deleteFicFiles.json');
                    }else if(obj.event == 'edit'){
                        utill.myalert('设备类型编辑',['392px','420px'],'home/popup/equipmentTypecs','.btn2',{
                            then:function(obj){
                                $('#tcTypeSupFic01').attr('disabled','disabled').css('border','0px');
                                $("[name='tcTypeLevel']").attr('disabled','disabled').css('border','0px');
                                $("[name='fic01']").attr('value',obj.fic01);
                                $("[name='fic02']").attr('value',obj.fic02);
                                $("[name='tcTypeSupFic01']").attr('value',obj.tcTypeSupFic01);
                                $("[name='tcTypeSupid']").attr('value',obj.tcTypeSupid);
                                $("[name='tcTypeLevel']").attr('value',obj.tcTypeLevel);
                                $("[name='tcTypeDsc']").attr('value',obj.tcTypeDsc);
                            },done:function(res,obj){
                                let data = res;
                                data.tcTypeSupFic01 = $("[name='tcTypeSupFic01']").data('id');
                                data.tcTypeId = obj.tcTypeId
                                utill.submit('/fil/updateByPrimaryKeySelective.json',data,'#equipmentType');
                                layer.closeAll();
                            }
                        },obj.data);
                    }
                })
                utill.alert({
                    then:function(obj){
                        admin.req({
                            url: api.host + '/fia/selectFic01.json',
                            type: 'get',
                            done: function (res) {
                                function transferKey(odata) {
                                    odata.forEach(obj => {
                                        obj.title = obj.fic02
                                        obj.children = obj.child
                                        delete obj["gem02"]
                                        delete obj["deptVOS"]
                                        if (obj.children instanceof Array) {
                                            transferKey(obj.children)
                                        }
                                    })
                                    return odata
                                }
                                odataArr = transferKey(res.data)
                                treeSelect.render({
                                    elem: "#tcTypeSupFic01",
                                    node: odataArr,
                                    done: (data) => {
                                        $("#tcTypeSupFic01").val(data.data.fic02);
                                        $("#tcTypeSupFic01").data('id',data.data.fic01);
                                        $("[name='tcTypeSupid']").attr('value',data.data.tcTypeId);
                                    }
                                })

                            }
                    });
                    },
                    done:function(res){
                        res.tcTypeSupFic01 = $("[name='tcTypeSupFic01']").data('id');
                        utill.submit('/fil/insertFicFile.json',res,'#equipmentType');
                        layer.closeAll();
                    }
                },'.eighthTable','新增设备类型',['392px','420px'],'home/popup/equipmentTypecs','.btn2',);
            }
        });
        });
    </script>